			$(document).ready(function() {
				gebo_upload.actions();
			});			
			gebo_upload = {
			      	//==================
			      	//file upload
			      	//==================
			        upload : function(object) {
							object.pluploadQueue({
			                // General settings
			                runtimes : 'html5,flash,silverlight',
			                url : '/PROJECT/fileInfo/fileUpload.action',
			                max_file_size : '10mb',
			                chunk_size : '1mb',
			                unique_names : true,
			                browse_button : 'pickfiles',
			                // Specify what files to browse for
			                filters : [
			                    {title : "Image files", extensions : "jpg,gif,png,jpeg,bmp"},
			                    {title : "Office files", extensions : "doc,docx,xls,xlsx,ppt,pptx"},
			                    {title : "PDF files", extensions : "pdf"},                    
			                    {title : "Zip files", extensions : "zip,rar"}
			                ],
			                // Flash settings
			                flash_swf_url : 'lib/plupload/js/plupload.flash.swf',
			                // Silverlight settings
			                silverlight_xap_url : 'lib/plupload/js/plupload.silverlight.xap'           
			            });
			        },

			      	//==================
			      	//get file for view
			      	//==================
					getFileListView : function (object,options){
					 	$.ajax({  
					    	url:'fileInfo/findFileList.action',  
					    	type:"post",  
					    	data:{   
					            funKeyId: object.data("funKeyId"),
					            mark: object.data("mark")
					        },
					    	success: function(msg){
					        	var data= {};
					        	data.selector = object.selector;
					        	data.msg = msg;
					        	var templateFn = doT.template(document.getElementById('uploadList-template').text);
					        	var content = templateFn(data);
								object.html(content);
								if(options!=null){
									options.success();
								}
							}
					    });	  
					 },
					 
			      	//==================
			      	//get file for edit
			      	//==================		
			        getFileListEdit : function (object) {
						 	$.ajax({  
						    	url:'fileInfo/findFileList.action',  
						    	type:"post",  
						    	data:{   
						            funKeyId: object.data("funKeyId"),
						            mark: object.data("mark")
						        },
						    	success: function(msg){
						        	var data= {};
						        	data.selector = object.selector;
						        	data.msg = msg;
						        	var templateFn = doT.template(document.getElementById('uploadEdit-template').text);
							  		var content = templateFn(data);
							  		object.html(content);
								}
						    }); 
					 },
					 
				     //==================
				     //delete file
				     //==================
					 deleteFile : function(object) {
						 try{
							 	$.ajax({  
							    	url:'fileInfo/deleteFile.action',  
							    	type:"post",  
							    	data:{
							 			id: object.data("id"),
							            funKeyId: object.data("funKeyId"),
							            mark: object.data("mark")
							        },
							    	success: function(msg){
							        	var data= {};
							        	data.selector = object.selector;
							        	data.msg = msg;
							        	var templateFn = doT.template(document.getElementById('uploadEdit-template').text);
								  		var content = templateFn(data);
										object.html(content);
									}
							    }); 							 
						 }
						 catch(err){
						 }
					 },
					 actions : function(){
						 $(".fileDelete").live("click", function(e){
							  var object = $($(this).data("selector"));
							  object.data("id",$(this).data("id"));
							  gebo_upload.deleteFile(object);
							  e.preventDefault();
						 });
					 }
			};			